package study.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;

public class MySecondServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html; charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.getWriter().write("<html><head><meta charset="+'"'+"utf-8"+'"'+"></head>");
        response.getWriter().write("<body>");
        response.getWriter().write("<h1>");
        response.getWriter().write("我是第三个包33333："+LocalDateTime.now().toString());
        response.getWriter().write("</h1>");
        response.getWriter().write("</body>");
        response.getWriter().write("</html>");
    }
}
